Fix fork PR docs workflow (check PR comment from the fork)#2911
Closed
antonwolfy wants to merge 4 commits into
Closed
Fix fork PR docs workflow (check PR comment from the fork)#2911antonwolfy wants to merge 4 commits into
antonwolfy wants to merge 4 commits into
Conversation
Contributor
antonwolfy
commented
May 11, 2026
- Have you provided a meaningful PR description?
- Have you added a test, reproducer or referred to an issue with a reproducer?
- Have you tested your changes locally for CPU and GPU devices?
- Have you made sure that new changes do not introduce compiler warnings?
- Have you checked performance impact of proposed changes?
- Have you added documentation for your changes, if necessary?
- Have you added your changes to the changelog?
The workflow incorrectly checked `base.repo.fork` (whether the target repository is a fork) instead of `head.repo.fork` (whether the source repository is a fork). This caused all PRs to IntelPython/dpnp to be treated as upstream PRs, including fork PRs, which led to 403 errors when trying to push to gh-pages. Changes: - Line 15: Changed base.repo.fork -> head.repo.fork in GH_EVENT_OPEN_PR_UPSTREAM - Line 238: Changed base.repo.fork -> head.repo.fork in clean job condition This bug was introduced in commit cb801da (PR IntelPython#2146, Nov 2024). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fork PRs cannot push to gh-pages due to restricted permissions, which causes 403 errors. This commit adds logic to detect fork PRs and handle them differently: - Added "Check if fork PR" step to detect fork PRs - Added "Upload docs artifact" step to save built docs as artifacts for fork PRs - Modified "Publish pull-request docs" to skip fork PRs Fork PRs will now pass the workflow by uploading artifacts instead of attempting to publish to gh-pages. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Added unified comment step that posts different messages based on PR type: - Fork PRs: Get detailed instructions for downloading and viewing docs artifact, including both gh CLI method and manual download steps - Upstream PRs: Get direct URL to published docs on GitHub Pages Both comment types use the same message-id so they update on subsequent pushes to the PR. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The GH_EVENT_OPEN_PR_UPSTREAM environment variable is no longer needed since we now explicitly check fork status with steps.check_fork.outputs.is_fork. Replaced with inline conditions that are more explicit and easier to read: - github.event_name == 'pull_request' - github.event.action != 'closed' - steps.check_fork.outputs.is_fork == 'false' Kept GH_EVENT_PUSH_UPSTREAM as it's still used for push-to-master deployments. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Collaborator
Contributor
Author
|
closing as no more relevant |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.